<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>await</title>
</head>
<body>
<script>
    //await 要放在 async 函数中

    // 创建Promise对象
    const p = new Promise((resolve, reject) => {
        resolve('Success~~')
    })

    async function main() {
            let result=await p;
            console.log(result)
    }
    main();
</script>
</body>
</html>